package org.paybiz.core.payplatform.yeePay.util;


/*
 * Description:联名账户异常
 * @author  LiChunming
 * @version V1.0 
 * @createDateTime：2010-9-20 下午05:55:08 
 * @Company: MSD. 
 * @Copyright: Copyright (c) 2010
 */
public class JointException extends Exception{
	/**
	 * 
	 */
	private static final long serialVersionUID = 8290196876656912547L;
	private String errCode;
	//1商品相关
	//1.1无此商品
	public static final String NO_GOOD = "011";
	//1.2此商品已经被删除
	public static final String GOOD_ALREADY_DELETE = "012";
	//1.3图片过大
	public static final String PIC_IS_TOO_LARGE = "013";
	
	
	public static final String USER_EXIST="001";
	
	public static final String USER_NOT_EXIST="002";
	
	
	//2商品类别
	//2.1无此类别
	public static final String NO_CAT = "021";
	//2.2此类别拥有子类别或商品
	public static final String HAVE_SUB="022";
	//2.3修改类别排序出错
	public static final String CAT_ORDER_ERROR="023";
	
	//3商品类型
	//3.1无此类型
	public static final String NO_TYPE = "031";
	//3.2此类型与商品关联
	public static final String HAVE_CAT="032";
	//3.3商品图片文件未找到
	public static final String FILE_NOT_FOUND="033";
	//3.4商品图片传输错误
	public static final String FILE_IO_ERROR="034";
	
	//4数字产品
	//4.1无此产品
	public static final String NO_PRODUCT="041";
	
	//5商品标签
	//5.1无此标签
	public static final String NO_TAG="051";
	//5.2商品已拥有此标签
	public static final String TAG_REL_EXSIT="052";
	//5.3无此商品标签相关联
	public static final String NO_TAG_REL="053";
	
	//6收藏品
	//6.1此收藏品不存在
	public static final String NO_COLLECTOR="061";
	//6.2此收藏品已经存在
	public static final String COLLECTOR_ALREAY_HAVE="062";
	//6.3此收藏不属于该用户
	public static final String NOT_YOU_COLLECTION="063";
	
	//7自定义类型
	//7.1无此自定义类型
	public static final String NO_SELFCAT="071";
	//7.2会员无此自定义类型
	public static final String NOT_HAVE_THIS_SELFCAT="072";
	//7.3此已经有了此分类
	//public static final String ALREADY_HAVE_THIS_SELFCAT="073";
	
	//8虚拟卡
	//8.1无此虚拟卡
	public static final String NO_CARD="081";
	public static final String CARD_SALES_DONE="082";
	//8.2虚拟卡不足
	public static final String NOT_ENOUGH_CARD="82";
	//9订单
	//9.1订单存在
	public static final String ORDER_EXIST="091";
	//9.6订单不存在
	public static final String NO_ORDER="096";
	//10.操作员
	//10.1操作员已存在
	public static final String OP_EXIST="101";
	//11.会员
	//11.1会员不存在
	public static final String NO_MEMBER="111";
	//11.2会员已存在
	public static final String MEMBER_ALREADY_EXSIT="112";
	//12.国金专用
	//12.1已经拥有此咨询
	public static final String ALREADY_HAVE_THIS_INFO="121";
	//12.2 用户提交参数失败，调用联名账户接口验签未通过
	public static final String PARAM_ERROR="122";
	//12.3 用户注册失败
	public static final String USER_REGIST_ERROR="123";
	//12.4 用户输入密码错误
	public static final String USER_PASSWORD_ERROR="124";
	//12.5 支付方式有误
	public static final String PAY_WAY_ERROR="125";
	//12.2此人未购买任何资讯
	public static final String DO_NOT_HAVE_INFO="126";
	public final String resourceName="com.yeepay.joint.exception.jointErr";
	
	
	//9.2修改批次失败
	public static final String UPDATE_BATCH_FAIL="092";
	
	//9.3该笔订单不存在
	public static final String ORDER_NOT_EXIST="093";
	
	//9.4该笔订单未支付
	public static final String ORDER_NOT_PAY="094";
	
	//9.5该笔订单支付失败
	public static final String ORDER_PAY_FAIL="095";
	
	//信协
	//密码格式错误
	public static final String PASSWORDINVALID="131";
	//非手机号
	public static final String ISMOBILE="132";
	//给自己转账
	public static final String SELFTRANSFER="133";
	public JointException(String errCode){
		this.errCode = errCode;
		this.err=errCode;
	}
	@Override
	public String getMessage() {
		PropertyUtil propertyUtil = PropertyUtil.getInstance(resourceName);
		String errMsg=null;
		try{
			errMsg=propertyUtil.getProperty(errCode);
		}catch(Exception e){
			if(errMsg==null){
				return err;
			}
		}
		return errMsg;
	}
	
	private String err;
	
	public String getErr() {
		return err;
	}
	public void setErr(String err) {
		this.err = err;
	}
	public String getErrCode() {
		return errCode;
	}
	public void setErrCode(String errCode) {
		this.errCode = errCode;
	}

}
